package oojo.data.spec.sub;

import oojo.data.spec.Update;

/**
 * Update an entity and associate it to a parent.
 */
public class SubUpdate<E> extends Update<E> {

    private Object parentId;
    
    public SubUpdate() {}
    
    public SubUpdate(E entity) {
        this(null, entity);
    }
    
    public SubUpdate(Object parentId, E entity) {
        super(entity);
        setParentId(parentId);
    }
    
    /**
     * The parent to associate with the entity.
     */
    public Object getParentId() {
        return parentId;
    }
    
    public void setParentId(Object parentId) {
        this.parentId = parentId;
    }
}
